import React, {Component} from 'react'

import {WebView, Dimensions, Text} from 'react-native'

const {width, height} = Dimensions.get('window');

export default class webView extends Component {
  // static navigationOptions = {
  //   headerTitle: '小编说',
  // }
  constructor(props){
    super(props)
    this.state={
      url:this.props.navigation.state.params.url
    }
  }

  componentDidMount(){
    // alert(this.props.navigation.state.params.url);
  }

  onNavigationStateChange = (navState) => {
    this.setState({
      backButtonEnabled: navState.canGoBack,
      forwardButtonEnabled: navState.canGoForward,
      url: navState.url,
      status: navState.title,
      loading: navState.loading,
      scalesPageToFit: true
    });
  };

  render() {
    return (
        <WebView
            style={{width: width, height: height}}
            source={{uri:this.state.url}}
            onNavigationStateChange={this.onNavigationStateChange}
        />
        /*<Text>webavie</Text>*/

    )
  }
}


